# makefile for tools - set of camera controlling programs

CC = arm-linux-gcc
KERNELPATH = ../../kernel/linux
INCLUDEPATH = -I ../driver/ -I $(KERNELPATH)/include

CFLAGS = $(INCLUDEPATH) -Wall

PROGRAMS = wr rd ver ff

# default target - build all programs
programs: $(PROGRAMS)

# implict rule for all source files
%.o : %.c tools.h
	$(CC) -c $(CFLAGS) -o $@ $<

# programs
wr: wr.o tools.o registers.o
	$(CC) -o wr wr.o registers.o tools.o

rd: rd.o tools.o registers.o
	$(CC) -o rd rd.o registers.o tools.o

ver: ver.o tools.o
	$(CC) -o ver ver.o tools.o

ff: ff.o tools.o
	$(CC) -o ff ff.o registers.o tools.o

# other targets
clean:
	rm -f *.o *~
	
distclean: clean
	rm -f $(PROGRAMS)
	
deploy: programs
	scp $(PROGRAMS) root@10.0.0.55:/autostop/bin